------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\agnolin\OneDrive - Università Commerciale Luigi Bocconi\CPS paper\Text-Tables\Paper\Submissions\CPS\Final_Resubmission\Replicati
> on_Folder\replication_colantone_stanig_logfile.log
  log type:  text
 opened on:   4 Jun 2024, 15:51:50

. 
. * Import data
. 
. use "./replication_colantone_stanig_2018.dta", clear

. 
. 
. * First define the regression sample from regression with longer equation
. 
. xtmixed leave import_shock immig_cultural age gender i.nuts1code i.education [pweight=wt_full_W8] ||nuts3: 

Obtaining starting values by EM: 

Performing gradient-based optimization: 

Iteration 0:   log pseudolikelihood = -7955.7465  
Iteration 1:   log pseudolikelihood = -7955.7449  
Iteration 2:   log pseudolikelihood = -7955.7449  

Computing standard errors:

Mixed-effects regression                        Number of obs     =     15,819
Group variable: nuts3                           Number of groups  =        167
                                                Obs per group:
                                                              min =          9
                                                              avg =       94.7
                                                              max =        291
                                                Wald chi2(19)     =    8375.06
Log pseudolikelihood = -7955.7449               Prob > chi2       =     0.0000

                                  (Std. err. adjusted for 167 clusters in nuts3)
--------------------------------------------------------------------------------
               |               Robust
         leave | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
---------------+----------------------------------------------------------------
  import_shock |   -.004222   .0329386    -0.13   0.898    -.0687804    .0603364
immig_cultural |   -.132042   .0023355   -56.54   0.000    -.1366195   -.1274644
           age |   .0022478   .0003289     6.83   0.000     .0016032    .0028925
        gender |  -.0115124   .0085762    -1.34   0.179    -.0283214    .0052966
               |
     nuts1code |
          UKD  |  -.0186323   .0269451    -0.69   0.489    -.0714438    .0341792
          UKE  |   .0296951   .0203108     1.46   0.144    -.0101133    .0695035
          UKF  |    .021823   .0246169     0.89   0.375    -.0264252    .0700712
          UKG  |   .0479625   .0240347     2.00   0.046     .0008552    .0950697
          UKH  |   .0078618   .0222271     0.35   0.724    -.0357026    .0514262
          UKI  |  -.0045352   .0221679    -0.20   0.838    -.0479835    .0389131
          UKJ  |  -.0010451   .0209422    -0.05   0.960    -.0420911    .0400009
          UKK  |   .0104669   .0230277     0.45   0.649    -.0346666    .0556003
          UKL  |  -.0516736   .0234548    -2.20   0.028    -.0976442    -.005703
          UKM  |   -.087038   .0202172    -4.31   0.000     -.126663    -.047413
               |
     education |
     GCSE D-G  |  -.0098087   .0228286    -0.43   0.667     -.054552    .0349345
    GCSE A*-C  |  -.0167832   .0174556    -0.96   0.336    -.0509955     .017429
      A-level  |  -.0622002   .0185457    -3.35   0.001    -.0985491   -.0258514
Undergraduate  |  -.1010529    .017639    -5.73   0.000    -.1356247   -.0664811
     Postgrad  |  -.1531381   .0198106    -7.73   0.000    -.1919663     -.11431
               |
         _cons |    .960925   .0343467    27.98   0.000     .8936067    1.028243
--------------------------------------------------------------------------------

------------------------------------------------------------------------------
                             |               Robust           
  Random-effects parameters  |   Estimate   std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
nuts3: Identity              |
                   sd(_cons) |   .0377881   .0063578      .0271733    .0525495
-----------------------------+------------------------------------------------
                sd(Residual) |   .3983161   .0031329      .3922228    .4045041
------------------------------------------------------------------------------

Warning: Sampling weights were specified only at the first level in a multilevel model. If these weights are indicative of overall and not
         conditional inclusion probabilities, then results may be biased.

. 
. cap drop in_broken

. 
. gen in_broken=e(sample)

. 
. *** Regression of vote for Leave on China shock, as in column 1 of Table 1
. 
. xtmixed leave import_shock age gender i.nuts1code i.education [pweight=wt_full_W8] if in_broken==1 ||nuts3:

Obtaining starting values by EM: 

Performing gradient-based optimization: 

Iteration 0:   log pseudolikelihood =  -10476.86  
Iteration 1:   log pseudolikelihood =  -10476.86  

Computing standard errors:

Mixed-effects regression                        Number of obs     =     15,819
Group variable: nuts3                           Number of groups  =        167
                                                Obs per group:
                                                              min =          9
                                                              avg =       94.7
                                                              max =        291
                                                Wald chi2(18)     =    1397.81
Log pseudolikelihood =  -10476.86               Prob > chi2       =     0.0000

                                  (Std. err. adjusted for 167 clusters in nuts3)
--------------------------------------------------------------------------------
               |               Robust
         leave | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
---------------+----------------------------------------------------------------
  import_shock |   .0815525   .0396134     2.06   0.040     .0039116    .1591934
           age |   .0051254   .0003534    14.50   0.000     .0044327     .005818
        gender |  -.0138171   .0097681    -1.41   0.157    -.0329621     .005328
               |
     nuts1code |
          UKD  |  -.0587524   .0301583    -1.95   0.051    -.1178615    .0003568
          UKE  |   .0000671   .0241724     0.00   0.998    -.0473098     .047444
          UKF  |   -.019924    .033115    -0.60   0.547    -.0848282    .0449802
          UKG  |   .0249694   .0272572     0.92   0.360    -.0284536    .0783925
          UKH  |   -.009053   .0275539    -0.33   0.742    -.0630577    .0449518
          UKI  |  -.0621208   .0260162    -2.39   0.017    -.1131117   -.0111299
          UKJ  |  -.0422629   .0238282    -1.77   0.076    -.0889653    .0044396
          UKK  |  -.0421931   .0288659    -1.46   0.144    -.0987691    .0143829
          UKL  |  -.0851117   .0326583    -2.61   0.009    -.1491208   -.0211026
          UKM  |   -.161873   .0228323    -7.09   0.000    -.2066234   -.1171226
               |
     education |
     GCSE D-G  |   -.028208   .0296064    -0.95   0.341    -.0862355    .0298195
    GCSE A*-C  |  -.0613047   .0203032    -3.02   0.003    -.1010982   -.0215112
      A-level  |  -.1652617   .0206627    -8.00   0.000    -.2057599   -.1247635
Undergraduate  |  -.2712308   .0207231   -13.09   0.000    -.3118474   -.2306142
     Postgrad  |  -.3811708   .0221745   -17.19   0.000     -.424632   -.3377097
               |
         _cons |   .4770768   .0363403    13.13   0.000      .405851    .5483025
--------------------------------------------------------------------------------

------------------------------------------------------------------------------
                             |               Robust           
  Random-effects parameters  |   Estimate   std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
nuts3: Identity              |
                   sd(_cons) |   .0523388   .0070664      .0401699     .068194
-----------------------------+------------------------------------------------
                sd(Residual) |   .4665429    .002191      .4622684     .470857
------------------------------------------------------------------------------

Warning: Sampling weights were specified only at the first level in a multilevel model. If these weights are indicative of overall and not
         conditional inclusion probabilities, then results may be biased.

. 
. *** Regression of vote for Leave on China shock controlling for immigration stances, as in column 2 of Table 1
. 
. xtmixed leave import_shock immig_cultural age gender i.nuts1code i.education [pweight=wt_full_W8] ||nuts3:

Obtaining starting values by EM: 

Performing gradient-based optimization: 

Iteration 0:   log pseudolikelihood = -7955.7465  
Iteration 1:   log pseudolikelihood = -7955.7449  
Iteration 2:   log pseudolikelihood = -7955.7449  

Computing standard errors:

Mixed-effects regression                        Number of obs     =     15,819
Group variable: nuts3                           Number of groups  =        167
                                                Obs per group:
                                                              min =          9
                                                              avg =       94.7
                                                              max =        291
                                                Wald chi2(19)     =    8375.06
Log pseudolikelihood = -7955.7449               Prob > chi2       =     0.0000

                                  (Std. err. adjusted for 167 clusters in nuts3)
--------------------------------------------------------------------------------
               |               Robust
         leave | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
---------------+----------------------------------------------------------------
  import_shock |   -.004222   .0329386    -0.13   0.898    -.0687804    .0603364
immig_cultural |   -.132042   .0023355   -56.54   0.000    -.1366195   -.1274644
           age |   .0022478   .0003289     6.83   0.000     .0016032    .0028925
        gender |  -.0115124   .0085762    -1.34   0.179    -.0283214    .0052966
               |
     nuts1code |
          UKD  |  -.0186323   .0269451    -0.69   0.489    -.0714438    .0341792
          UKE  |   .0296951   .0203108     1.46   0.144    -.0101133    .0695035
          UKF  |    .021823   .0246169     0.89   0.375    -.0264252    .0700712
          UKG  |   .0479625   .0240347     2.00   0.046     .0008552    .0950697
          UKH  |   .0078618   .0222271     0.35   0.724    -.0357026    .0514262
          UKI  |  -.0045352   .0221679    -0.20   0.838    -.0479835    .0389131
          UKJ  |  -.0010451   .0209422    -0.05   0.960    -.0420911    .0400009
          UKK  |   .0104669   .0230277     0.45   0.649    -.0346666    .0556003
          UKL  |  -.0516736   .0234548    -2.20   0.028    -.0976442    -.005703
          UKM  |   -.087038   .0202172    -4.31   0.000     -.126663    -.047413
               |
     education |
     GCSE D-G  |  -.0098087   .0228286    -0.43   0.667     -.054552    .0349345
    GCSE A*-C  |  -.0167832   .0174556    -0.96   0.336    -.0509955     .017429
      A-level  |  -.0622002   .0185457    -3.35   0.001    -.0985491   -.0258514
Undergraduate  |  -.1010529    .017639    -5.73   0.000    -.1356247   -.0664811
     Postgrad  |  -.1531381   .0198106    -7.73   0.000    -.1919663     -.11431
               |
         _cons |    .960925   .0343467    27.98   0.000     .8936067    1.028243
--------------------------------------------------------------------------------

------------------------------------------------------------------------------
                             |               Robust           
  Random-effects parameters  |   Estimate   std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
nuts3: Identity              |
                   sd(_cons) |   .0377881   .0063578      .0271733    .0525495
-----------------------------+------------------------------------------------
                sd(Residual) |   .3983161   .0031329      .3922228    .4045041
------------------------------------------------------------------------------

Warning: Sampling weights were specified only at the first level in a multilevel model. If these weights are indicative of overall and not
         conditional inclusion probabilities, then results may be biased.

. 
. 
. *** Regression of immigration stances on China, as in column 1 of Table 2
. 
. xtmixed immig_cultural import_shock age gender i.nuts1code i.education if in_broken==1 ||nuts3:

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =   -32321.2  
Iteration 1:   log likelihood = -32321.199  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =     15,819
Group variable: nuts3                           Number of groups  =        167
                                                Obs per group:
                                                              min =          9
                                                              avg =       94.7
                                                              max =        291
                                                Wald chi2(18)     =    2884.49
Log likelihood = -32321.199                     Prob > chi2       =     0.0000

--------------------------------------------------------------------------------
immig_cultural | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
---------------+----------------------------------------------------------------
  import_shock |  -.6270397   .1733034    -3.62   0.000    -.9667081   -.2873714
           age |  -.0210982   .0009639   -21.89   0.000    -.0229874   -.0192089
        gender |   .0757365   .0299049     2.53   0.011     .0171239    .1343491
               |
     nuts1code |
          UKD  |   .2502082   .1227245     2.04   0.041     .0096725    .4907439
          UKE  |    .160034    .129102     1.24   0.215    -.0930013    .4130694
          UKF  |   .2988625   .1349549     2.21   0.027     .0343559    .5633692
          UKG  |   .0984199   .1295735     0.76   0.448    -.1555395    .3523793
          UKH  |   .1553723   .1255702     1.24   0.216    -.0907407    .4014852
          UKI  |   .4824349   .1211155     3.98   0.000     .2450528     .719817
          UKJ  |   .2345506   .1198791     1.96   0.050    -.0004082    .4695093
          UKK  |   .3312578   .1281597     2.58   0.010     .0800694    .5824462
          UKL  |    .400719   .1280767     3.13   0.002     .1496934    .6517447
          UKM  |   .5728832   .1192574     4.80   0.000     .3391431    .8066233
               |
     education |
     GCSE D-G  |   .1491273   .0867102     1.72   0.085    -.0208216    .3190761
    GCSE A*-C  |   .2791084   .0618997     4.51   0.000     .1577872    .4004297
      A-level  |   .8659582   .0634284    13.65   0.000     .7416409    .9902755
Undergraduate  |   1.465934   .0599747    24.44   0.000     1.348386    1.583482
     Postgrad  |   1.970741   .0709118    27.79   0.000     1.831757    2.109726
               |
         _cons |   3.542508   .1478168    23.97   0.000     3.252792    3.832224
--------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects parameters  |   Estimate   Std. err.     [95% conf. interval]
-----------------------------+------------------------------------------------
nuts3: Identity              |
                   sd(_cons) |   .1712932   .0217597      .1335397    .2197203
-----------------------------+------------------------------------------------
                sd(Residual) |   1.861312   .0105161      1.840815    1.882038
------------------------------------------------------------------------------
LR test vs. linear model: chibar2(01) = 37.66         Prob >= chibar2 = 0.0000

. 
. 
. * close log file
. 
. log close
      name:  <unnamed>
       log:  C:\Users\agnolin\OneDrive - Università Commerciale Luigi Bocconi\CPS paper\Text-Tables\Paper\Submissions\CPS\Final_Resubmission\Replicati
> on_Folder\replication_colantone_stanig_logfile.log
  log type:  text
 closed on:   4 Jun 2024, 15:52:11
------------------------------------------------------------------------------------------------------------------------------------------------------
